package YW.v;

import java.awt.Color;
import java.awt.Dimension;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.util.Observable;
import java.util.Observer;

import javax.swing.JFrame;
import javax.swing.JPanel;

import org.tekkotsu.mon.VisionListener;
import YW.c.VisionPanel_controller;
import YW.m.VisionPanel_model;
import javax.swing.border.TitledBorder;

public class VisionPanel_view extends JPanel implements Observer{
	VisionPanel_model model;
	VisionPanel_controller controller;
	VisionListener visionListener;
	
	JPanel viewPanel;
	
	/**
	 * Create the panel.
	 */
	public VisionPanel_view(VisionPanel_model m, VisionPanel_controller c) {
		model = m;
		controller = c;
		
		model.addObserver(this);		
	}

	public VisionPanel_view() {
		
		JPanel panel = new JPanel();
		panel.setBorder(new TitledBorder(null, "ViewPanel", TitledBorder.LEADING, TitledBorder.TOP, null, null));
		add(panel);

	}
	public void creatView(){
		
	}
	@Override
	public void update(Observable o, Object arg) {
		model.get
		
	}
	
	public static void main(String[] args){
		JFrame frame=new JFrame("Vision Panel View test");
		frame.setBackground(Color.black);
		//frame.getContentPane().setLayout(new FlowLayout());
		frame.setSize(new Dimension(VisionListener.DEFAULT_WIDTH*2, VisionListener.DEFAULT_HEIGHT*2)); 
		VisionPanel_view vision=new VisionPanel_view();
		frame.getContentPane().add(vision);
		frame.addWindowListener(new WindowAdapter() {
			public void windowClosing(WindowEvent e) { System.exit(0); } });
		//frame.show();
		frame.setVisible(true);
	}
	

}
